Choice

The next operation is choice, for which the operator is |. It has the lowest priority of all. Entering x | y | z produces
\begin{rail}
x \vert y \vert z
\end{rail}
With this operator, parentheses are significant. The expressions ( x | y ) | z and x | ( y | z ) produce
\begin{rail}
( x \vert y ) \vert z
\end{rail}
and
\begin{rail}
x \vert ( y \vert z )
\end{rail}
respectively, which have a different layout (but represent the same language).

Related to choice are priority annonations, of the form [string]. An example of their use can be seen in the railroad diagram for body. They should only be used with the top-level choice of a rule body, since otherwise their meaning is not clear. As an example, [1] x y | [2] z produces
\begin{rail}[1]x y \vert [2] z
\end{rail}
When used with identifiers as in body[2--5] they produce
\begin{rail}
body[2--5]
\end{rail}
The string between [ and ] may not contain tabs, newlines or ]. Remember that you should use -- to produce a number dash (see LATEX: A Document Preparation System, page 14).